package com.ztp.pc.test2;

import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Properties;

import org.sqldroid.SQLDroidDriver;



import static java.lang.System.out;
public class Main2 {

	/**
	 * @param args
	 */
	
	public static void main(String[] args) {
		
		
		
			
		
		/*
		Properties p = System.getProperties();
		String  [] keys = new String [p.keySet().size()];
		p.keySet().toArray(keys);
		
		Arrays.sort(keys);
		
		for(String k : keys){
			System.out.println(k);
			System.out.println("\t" + p.getProperty(k));
		}
		
		*/
		
		
		/*SQLiteDataSource ds = new SQLiteDataSource();
		ds.setUrl("jdbc:sqlite:test2.db");
		Statement stmnt =  null;
		try {
			Connection con2 = ds.getConnection();
			stmnt = con2.createStatement();
			
			String sqt = "create table test (id int primary key, text name default \"qwe\" )";
			stmnt.executeUpdate(sqt);
			stmnt.close();
			con2.close();
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		*/
		
		/*
		Connection conn = null;
		Statement stm = null;
		try {
			Class.forName("com.mysql.jdbc.Driver");
			conn = DriverManager.getConnection("jdbc:mysql://192.168.1.3:3306/test", "test", "test");
			stm = conn.createStatement();
			stm.execute("select * from test");
			ResultSet rs = stm.getResultSet();
			ResultSetMetaData rsmd = rs.getMetaData();
			int cols = rsmd.getColumnCount();
			out.println("cols " + cols);
			while(rs.next()){
				String line  = "";
				for(int i=1 ; i<=cols ; i++){
					line += (rs.getString(i) + "\t");
				}
				out.println(line);
			}
			rs.close();
			conn.close();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		*/
		
		
		/*
		Connection conn = null;
		try {
			Class.forName("org.sqlite.JDBC");
			conn = DriverManager.getConnection("jdbc:sqlite:test.db");
			conn.close();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		*/
		
	}

}
